/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mascotrin;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ProgressMonitor;

/**
 *
 * @author SQL
 */
public class BarraProceso implements Runnable{
 private ProgressMonitor pm;
 Thread hilo;
 boolean terminar= false;
public BarraProceso(){
    hilo = new Thread(this);    
   pm = new ProgressMonitor(null,"Iniciando","Creando Tablas",0,100);
   hilo.start();
}
public void stop(boolean terminar)
{
    this.terminar = terminar;
}
int x;
public void avanza(int x)
{
    this.x =x;
            
}
    public void run() {        
         try {
         do{
            
                pm.setProgress(x);
                x++;
                Thread.sleep(100);
            }while(x<=100);
         }
          catch (InterruptedException ex) {
                Logger.getLogger(BarraProceso.class.getName()).log(Level.SEVERE, null, ex);
            }
    }

}
